package xyz.zq.validation.entity;

import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import xyz.zq.validation.annotation.MyValid;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.UUID;

@Data
@Accessors(chain = true)
public class User {


    private UUID id;

    @Length(min = 6, max = 18)
    @NotBlank
    private String username;

    @MyValid(message = "密码错误")
    private String password;

    @NotNull(message = "状态不能为空")
    private Integer lock;

    @NotNull
    private Integer isDelete;

    @Valid
    private List<Dep> deps;


}
